
import uuid
import libnum
import gmpy2
import os
flag = "flag{" + str(uuid.uuid4()) + "}"
flag = flag.encode()+os.urandom(10)
m = libnum.s2n(flag)
print(gmpy2.bit_length(m))
print(flag)
e = 65537

p1 = libnum.generate_prime(128)
q1 = libnum.generate_prime(128)
p2 = libnum.generate_prime(128)
q2 = libnum.generate_prime(128)
p3 = libnum.generate_prime(128)
q3 = libnum.generate_prime(128)
p4 = libnum.generate_prime(128)
q4 = libnum.generate_prime(128)
print("p1=", p1)
print("q1=", q1)
print("p2=", p2)
print("q2=", q2)
print("p3=", p3)
print("q3=", q3)
print("p4=", p4)
print("q4=", q4)
n1 = p1 * q1
n2 = p2 * q2
n3 = p3 * q3
n4 = p4 * q4

c1 = pow(m, e, n1)
c2 = pow(m, e, n2)
c3 = pow(m, e, n3)
c4 = pow(m, e, n4)
print("c1=", c1)
print("c2=", c2)
print("c3=", c3)
print("c4=", c4)

p1= 174738770926098295877142372925892999159
q1= 200317117249810378861043353401464115731
p2= 172803905694548913925880958793658854061
q2= 191755452439069179673393399453503486079
p3= 178711865370876498627483472718654854453
q3= 331098238738858355352692009468674875359
p4= 178711865370876498627483472718654854453
q4= 331098238738858355352692009468674875359
c1= 1792150618562701851813740961084232970561767012507072283546793040062963527457
c2= 18923157642326948142790032536890486231243642872424603866953438161539360497026
c3= 64245666888744246777656128683077880967553078586283697543513884285118543732552
c4= 32943324505208016941899340334172638056563407600199378273925691614416537728904